package com.gitee.aurora.engine.vo;

import org.springframework.util.CollectionUtils;
import org.springframework.util.LinkedCaseInsensitiveMap;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * author: jiangfuxiao
 * Date:2022/9/24 16:42
 */
public class StDataResultVo {
    private List<LinkedHashMap<String, Object>> zfjdData ;
    private List<DataResultVo> sjzxData;
    private List<LinkedCaseInsensitiveMap<Object>> stSjzxData ;
    private Integer baqCount;
    private Integer sjzxCount;
    private Integer stSjzxCount;
    private Integer zfjdCount;




    public Integer getBaqCount(){
        AtomicInteger allAaqCount = new AtomicInteger(0);
        this.sjzxData.forEach(v -> {
            allAaqCount.set(allAaqCount.get()+v.getBaqCount());
        });
        this.baqCount = allAaqCount.get();
        return this.baqCount;
    }

    public Integer getSjzxCount(){
        if (!CollectionUtils.isEmpty(this.sjzxData)){
            AtomicInteger allSjzxCount = new AtomicInteger(0);
            this.sjzxData.forEach(v -> {
                allSjzxCount.set(allSjzxCount.get()+v.getSjzxCount());
            });
            this.baqCount = allSjzxCount.get();
        }else {
            this.baqCount = 0;
        }
        return this.baqCount;
    }

    public Integer getZfjdCount(){
        if (!CollectionUtils.isEmpty(this.zfjdData)){
            this.zfjdCount = this.zfjdData.size();
        }else {
            this.zfjdCount=0;
        }
        return this.zfjdCount;
    }

    public Integer getStSjzxCount(){
        if (!CollectionUtils.isEmpty(this.stSjzxData)){
            this.stSjzxCount = this.stSjzxData.size();
        }else {
            this.stSjzxCount = 0;
        }
        return this.stSjzxCount;
    }

    public List<LinkedHashMap<String, Object>> getZfjdData() {
        return zfjdData;
    }

    public void setZfjdData(List<LinkedHashMap<String, Object>> zfjdData) {
        this.zfjdData = zfjdData;
    }

    public List<DataResultVo> getSjzxData() {
        return sjzxData;
    }

    public void setSjzxData(List<DataResultVo> sjzxData) {
        this.sjzxData = sjzxData;
    }

    public List<LinkedCaseInsensitiveMap<Object>> getStSjzxData() {
        return stSjzxData;
    }

    public void setStSjzxData(List<LinkedCaseInsensitiveMap<Object>> stSjzxData) {
        this.stSjzxData = stSjzxData;
    }

    public void setBaqCount(Integer baqCount) {
        this.baqCount = baqCount;
    }

    public void setSjzxCount(Integer sjzxCount) {
        this.sjzxCount = sjzxCount;
    }

    public void setStSjzxCount(Integer stSjzxCount) {
        this.stSjzxCount = stSjzxCount;
    }

    public void setZfjdCount(Integer zfjdCount) {
        this.zfjdCount = zfjdCount;
    }
}
